home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / video / pictetri.src / pictetri / pictetris-src / pieces.c < prev    next >
C/C++ Source or Header  |  1995-12-19  |  2KB  |  84 lines

  1. /***************************************************************************\
  2. |*                                       *|
  3. |*  pieces.c:    A version of Tetris to run on Linux SVGAlib console.       *|
  4. |*        This module contains the definitions of the pieces.       *|
  5. |*                                       *|
  6. |*  Authors:    Mike Taylor (mirk@uk.ac.warwick.cs) &               *|
  7. |*        Arturo Espinosa (arturo@nuclecu.unam.mx)           *|
  8. |*  Started:    Fri May 26 12:26:05 BST 1989 (tetris for terminals)       *|
  9. |*            Dic 1, 1995 (pictetris)                       *|
  10. |*                                       *|
  11. \***************************************************************************/
  12.  
  13. #include "pictetris.h"
  14. #include "pieces.h"
  15.  
  16. /*-------------------------------------------------------------------------*/
  17.  
  18. struct piece pieces[NO_PIECES] = {
  19.   { "[]", 4,            /* Square piece */
  20.       {
  21.     {{0,0}, {0,1}, {1,0}, {1,1}},
  22.     {{0,0}, {0,1}, {1,0}, {1,1}},
  23.     {{0,0}, {0,1}, {1,0}, {1,1}},
  24.     {{0,0}, {0,1}, {1,0}, {1,1}}
  25.       }
  26.   },
  27.   
  28.   { "<>", 2,            /* Long piece */
  29.       {
  30.     {{0,0}, {1,0}, {2,0}, {3,0}},
  31.     {{1,-1}, {1,0}, {1,1}, {1,2}},
  32.     {{0,0}, {1,0}, {2,0}, {3,0}},
  33.     {{1,-1}, {1,0}, {1,1}, {1,2}}
  34.       }
  35.   },
  36.   
  37.   { "()", 3,            /* L-shaped piece */
  38.       {
  39.     {{0,0}, {1,0}, {2,0}, {2,1}},
  40.     {{0,1}, {1,-1}, {1,0}, {1,1}},
  41.     {{0,-1}, {0,0}, {1,0}, {2,0}},
  42.     {{1,-1}, {1,0}, {1,1}, {2,-1}}
  43.       }
  44.   },
  45.   
  46.   { "{}", 3,            /* Backwards L-shaped piece */
  47.       {
  48.     {{0,0}, {1,0}, {2,-1}, {2,0}},
  49.     {{1,-1}, {1,0}, {1,1}, {2,1}},
  50.     {{0,0}, {0,1}, {1,0}, {2,0}},
  51.     {{0,-1}, {1,-1}, {1,0}, {1,1}}
  52.       }
  53.   },
  54.   
  55.   { "##", 1,            /* T-shaped piece */
  56.       {
  57.     {{1,-1}, {1,0}, {1,1}, {2,0}},
  58.     {{0,0}, {1,0}, {1,1}, {2,0}},
  59.     {{0,0}, {1,-1}, {1,0}, {1,1}},
  60.     {{0,0}, {1,-1}, {1,0}, {2,0}}
  61.       }
  62.   },
  63.   
  64.   { "%%", 5,            /* S-shaped piece */
  65.       {
  66.     {{0,0}, {0,1}, {1,-1}, {1,0}},
  67.     {{0,-1}, {1,-1}, {1,0}, {2,0}},
  68.     {{0,0}, {0,1}, {1,-1}, {1,0}},
  69.     {{0,-1}, {1,-1}, {1,0}, {2,0}}
  70.       }
  71.   },
  72.   
  73.   { "@@", 5,            /* Backwards S-shaped piece */
  74.       {
  75.     {{0,-1}, {0,0}, {1,0}, {1,1}},
  76.     {{0,0}, {1,-1}, {1,0}, {2,-1}},
  77.     {{0,-1}, {0,0}, {1,0}, {1,1}},
  78.     {{0,0}, {1,-1}, {1,0}, {2,-1}}
  79.       }
  80.   },
  81. };
  82.  
  83. /*-------------------------------------------------------------------------*/
  84.